const { adminsModel } = require('./models/adminsModel.js');
const { salespersonsModel } = require('./models/salespersonsModel.js');

module.exports.login = async ({ identity, account, password }) => {
    if (identity == 'Sidebar') {
        return await adminsModel.find({ account, password });
    }
    return await salespersonsModel.find({ salesAccount: account, salesPassword: password });
}